import FocusParentObj from "../Common/FocusParentObj";
import Sound from "../../../../constant/SoundNameConstant";

export default class GasStove extends FocusParentObj {
    /** 当前是否是点燃状态*/
    private isFired: boolean = false;
    /** 煤气开关*/
    private gasButton: Laya.Sprite3D;
    /** 火焰特效节点*/
    private fireEffRoot: Laya.Sprite3D;
    onStart() {
        super.Start();
        this.gasButton = this.owner.getChildByName("gasButton") as Laya.Sprite3D;
        this.fireEffRoot = this.owner.getChildByName("gasFires") as Laya.Sprite3D;
        this.fireEffRoot.active = false;
    }
    /** 放置煤气开关*/
    public PutGasButton(): void {
        this.gasButton.active = true;
    }
    /** 开火交互*/
    public InteractGas(): void {
        this.isFired = !this.isFired;
        this.fireEffRoot.active = this.isFired;
        if (this.isFired) {
            window.gameFacade.SoundMng.playSound(Sound.soundClipArr.FIRE)
        }
    }
}